package com.jxmcloud.business.cut.service.database;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.jxmcloud.business.cut.model.database.DBUserInviteSuccess;
import com.jxmcloud.business.cut.model.query.InviteSuccessQuery;
import com.jxmcloud.business.cut.vo.InviteSuccessVo;

import java.util.List;

public interface IUserInviteSuccessDBService extends IService<DBUserInviteSuccess> {
    /**
     * 基本数据插入
     * @param info
     * @return
     */
    boolean insertIntoData(DBUserInviteSuccess info);

    // 批量查找
    List<DBUserInviteSuccess> selectAll(Integer uid, Integer activityId);

    // 数据删除
    boolean deleteData(Integer uid);

    // 基本数据修改
    boolean updateData(DBUserInviteSuccess info);

    /**
     * 查询某个人的助力数据
     * @param uid
     * @param helperXlId  助力人玄乐id
     * @param activityId
     * @return
     */
    DBUserInviteSuccess selectHelpInfo(Integer uid, Integer helperXlId, Integer activityId);


    /**
     * 查询一个未领取奖励的数据行
     * @param uid
     * @return
     */
    DBUserInviteSuccess selectCanGainAwardInfo(Integer uid, Integer activityId);

    /**
     * 查询所有可领取的新人数据行
     * @param uid
     * @param activityId
     * @return
     */
    List<DBUserInviteSuccess> selectCanGainNewerAwardInfoAll(Integer uid, Integer activityId);

    /**
     * 查询邀请的所有新人
     * @param uid
     * @param activityId
     * @return
     */
    List<DBUserInviteSuccess> selectInviteNewersList(Integer uid, Integer activityId);

    /**
     * 查询邀请的所有新人数量
     * @param uid
     * @param activityId
     * @return
     */
    int selectInviteNewersCount(Integer uid, Integer activityId);

    /**
     * 更新奖励已领取
     * @param id 主键id
     * @return
     */
    boolean updateGainAward(Integer id);

    IPage<InviteSuccessVo> getInviteSuccessPage(InviteSuccessQuery query);

    /**
     * 查询 该用户下 的助力 存不存在
     * @param account
     */
    boolean checkExitByInvitedAccount(String account);
}
